﻿@using Sexybeauty.Core.Inf.LogicEntity;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section script{
    <link type="text/css" href="/content/css/style.css" rel="stylesheet" media="all" />
    <link type="text/css" href="/content/css/lightbox.css" rel="stylesheet" media="screen" />
    <script type="text/javascript" src="/scripts/jquery-1.5.1.min.js" ></script>
    <script type="text/javascript" src="/scripts/plug.js"></script>
    <script type="text/javascript">
        function OpenResetInfpLayer() {
            new plug.PopFrame().OpenFrame('resetinfobox', 'btnclose', function () {
                new plug.AValidator().BuildValidate('updateInfoform');
            });
        }
        function TrgResetInfo() {
            $('#btntrgresetinfo').trigger('click');
        } 
    </script>
}
@{MemberEntity user = ViewBag.User;}
<div class="content">
 <div class="content-left">
  <div class="content-close"><img src="/content/images/btn-img.jpg" /></div>
  <div class="content-img"><a href="info-1.html"><img src="/content/images/img-l.jpg" /></a></div>
 </div>
 <div class="content-right">
  <div class="content-img"><a href="info-1.html"><img src="/content/images/img-r.gif" /></a></div>
  <div class="content-close"><img src="/content/images/btn-img.jpg" /></div>
 </div>
 <div class="content-center">
  <div class="contents">
   <div class="contents-t">
    <div class="contents-tital"></div>
    <div class="contents-info">&nbsp;</div>
   </div>
   <div class="contents-c">
    <div class="info">
     <div class="info-left">
      <div class="info-left-img"><img style="width:194px;height:244px;" src="@(String.IsNullOrEmpty(user.MemberDetail.MainPhoto) ? ((user.Gender == Gender.Male) ? "/content/images/vip.jpg" : "/content/images/vip.jpg") : user.MemberDetail.MainPhoto)" /></div>
      <div class="info-left-links" style="height:45px;">
      <div class="info-left-links-1" style="float:right;width:80px;"><a href="javascript:;"><img src="/content/images/icon-4.jpg" /><label>更换头像</label></a></div>
       <div class="info-left-links-2"><img src="/content/images/icon-1.png" />你有<a href="#">3</a>条信息<a href="#" style="text-decoration:underline;">点击查看</a></div>
      </div>
      <div class="info-left-history">
       <div class="history">
        <div class="history-t"><span>关注</span></div>
        <div class="history-c">
        @{
            List<MemberEntity> frends = ViewBag.Frend;
            foreach(MemberEntity item in frends){
            <div>
                <a href="javascript:;"><img src="@item.MemberDetail.MainPhoto" /></a>
                <a>@item.NickName</a> 
                <span>@item.Area.Mapping() @((int)(DateTime.Now.Subtract(item.Birthday).TotalDays / 365))岁</span>
            </div>
            }
            }     
         <li class="clear"></li>
        </div>
       </div>
      </div>
     </div>
     <div class="info-right">
      <div class="info-right-t"><a class="info-right-t-active" href="vip-1.html">个人资料</a><a href="vip-2.html">写真影集</a><a href="vip-3.html">留言信息</a><a href="vip-3.html">财富明细</a></div>
      <div class="info-right-c">
       <div class="info">
        <div class="info-t" style="height:30px; padding-left:10px; font-size:20px;">
            <div style="width:100px; overflow:hidden; height:30px; line-height:30px; float:left;font-weight:bold;">@user.NickName</div>
            <div style="float:left; height:30px; line-height:30px; font-size:12px; padding-top:7px; color:#999; padding-left:10px;">@(String.IsNullOrEmpty(user.MemberDetail.Words)?"说点什么吧，让别人知道怎么来接触你！":user.MemberDetail.Words)</div>
        </div>
        <div class="info-img"><img src="/content/images/heart.png" /><img src="/content/images/heart.png" /><img src="/content/images/heart.png" /><img src="/content/images/heart.png" /><img src="/content/images/heart.png" /></div>
        <div class="info-text">
         <ul>
          <li style="color:#f5cd41; height:30px; line-height:30px;"><span>财富指数:</span><label>100.00￥</label><a style="margin-left:5px; text-decoration:underline; color:#bfabaf;" href="rechargeable.html">充值</a><a style="margin-left:5px; text-decoration:underline; color:#bfabaf;" href="vip-4.html">消费查询</a></li>
          <li style="color:#e63b9c; height:30px; line-height:30px;"><span>人气指数:</span><label>100</label></li>
          <li style="color:#e63b9c; height:30px; line-height:30px;">&nbsp;</li>
          <li style="color:#e63b9c; height:30px; line-height:30px; width:300px;">
          @user.Gender.Mapping() - 生日：@user.Birthday.ToString("yyyy年MM月dd日") &nbsp;&nbsp;&nbsp;&nbsp;现居：@user.Area.Mapping()</li>
          <li style="color:#e63b9c; height:30px; line-height:30px;">&nbsp;</li>
          @{if(String.IsNullOrEmpty(user.Phone) || String.IsNullOrEmpty(user.QQ)){
              <li style="color:red; height:30px; line-height:30px; width:500px;">
                注：您还没有添加联系手机或QQ号，这将严重影响您的交友效果 <a href="javascript:;" onclick="TrgResetInfo()" style="font-size:15px; font-weight:bold;">立即添加</a>
              </li>
              }
           }
         </ul>
        </div>
        <div class="info-btn" style="padding-top:10px;padding-right:5px;"><input id="btntrgresetinfo" type="button" onclick="OpenResetInfpLayer()" value="修改信息" /></div>
       </div>
       <div class="vip-img">
        <div class="vip-img-t"><span>人气影集</span></div>
         <div class="info-btn"><input type="button" value="上传照片" /></div>
        <div class="vip-img-c" style="padding-bottom:10px;">
         <div class="img_container">
          <ul>
          @{
              List<MemberResourceEntity> list = ViewBag.Album;
              foreach (MemberResourceEntity item in list)
              {
                <li><a href="@item.Path"><img src="@item.Snapshot" alt=""/></a><span><img src="/content/images/delet.jpg" /></span></li>  
              }
              }      
          </ul>
        </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
  <div class="clear"></div>
 </div>
</div>
<div id="resetinfobox" style="display:none; width:430px; height:450px;"> 
    <form id="updateInfoform" action="/member/resetinfo" method="post">
        <div style="width:420px; margin-left:auto; margin-right:auto;">
           <div style="height:35px;">
            <img id="btnclose" style=" cursor:pointer; float:right;" alt="close" src="/content/images/closelabel.gif" />
           </div>
           <div style="height:40px; border-bottom:1px solid #999; line-height:40px; font-size:22px; font-weight:bold; color:#280000;">
            修改信息
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">昵称：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="text" name="nickname" av="{x:':[^<>&]{1,10}',t:'errormsg',m:'* 请输入1-10个字符代表昵称'}" style="width:230px;" value="@user.NickName" />
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">宣言：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="text" name="words" style="width:230px;" value="@user.MemberDetail.Words" />
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">性别：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="radio" value="0" name="gender" id="radmale" @(user.Gender == Gender.Male ? "checked=checked" : "")/><label for="radmale">男</label>
                <input type="radio" value="1" name="gender" id="radfemale" @(user.Gender == Gender.Female ? "checked=checked" : "") /><label for="radfemale">女</label>
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">生日：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="text" name="birthday" av="{x:'$date',t:'errormsg',m:'* 请输入正确的出生日期'}" style="width:230px;" value="@user.Birthday.ToString("yyyy-MM-dd")" />
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;"></div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                居住于<select name="area" style="width:70px">
                    <option value="0">0</option>
                </select> 是
                <select name="role" style="width:80px;">
                    <option value="0">学生</option>
                </select>
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">QQ：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="text" name="qq" style="width:230px;" value="@user.QQ" />
            </div>
           </div>
           <div style="height:40px; line-height:40px;color:#000; font-size:14px;">
            <div style="width:20%;height:40px; line-height:40px; text-align:right; float:left;">手机号：</div>
            <div style="width:80%;height:40px; line-height:40px; float:left;">
                <input type="text" name="phone" style="width:230px;" value="@user.Phone" />
            </div>
           </div>
            <div style="height:35px; line-height:40px;color:#000; font-size:14px; text-align:center;">
                <input type="submit" value="确认修改" style="width:80px; height:20px; border:1px solid #ccc;" />
            </div>
            <div id="errormsg" style="height:35px; line-height:35px; color:Red; text-align:left; padding-left:80px; font-size:18px;">
            </div>
        </div>
    </form>
</div>